<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/page/public/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>我的话单统计</title>
<%@ include file="/WEB-INF/page/public/contentmeta.jsp"%>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="<%=basePath%>css/global.css" media="all" />
<link rel="stylesheet" href="<%=basePath%>plugins/font-awesome/css/font-awesome.min.css"/>
<link rel="stylesheet" href="<%=basePath%>css/system.css" media="all"/>
<link rel="stylesheet" href="<%=basePath%>css/tab.css" media="all" />
<script type="text/javascript" src="/js/record_paly.js"></script>
<style type="text/css">

/* 收款弹窗 */
.collection-money { display:none; }

</style>
</head>
<body>

<div class="admin-tab admin-user">
    <div class="tab-condition">
        <form class="layui-form clefix" id="calllogform" action="/user/mycallloglist" method="post">
        
            <div class="layui-form-item">
            	<div class="layui-input-block" style="width:170px;">
            		<select name="type" id="type" value="${pager.params.type}" lay-filter="type">
            			   <option value="-1" <c:if test="${pager.params.type==-1}">selected</c:if>>全部</option>
            		       <option value="2" <c:if test="${pager.params.type==2}">selected</c:if>>已接去电</option>
            		     	<option value="1" <c:if test="${pager.params.type==1}">selected</c:if>>已接来电</option>
            				<option value="3" <c:if test="${pager.params.type==3}">selected</c:if>>未接来电</option>
            			<option value="4" <c:if test="${pager.params.type==4}">selected</c:if>>未接去电</option>
            		</select>
            	</div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block" style="width:170px;">
                    <input type="text" style="width:170px;" name="sttime" id="sttime"  placeholder="起始时间" autocomplete="off" class="layui-input" onclick="layui.laydate({elem: this})" value="${pager.params.sttime}">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block" style="width:170px;">
                    <input type="text" style="width:170px;" name="entime" id="entime"  placeholder="结束时间" autocomplete="off" class="layui-input" onclick="layui.laydate({elem: this})" value="${pager.params.entime}">
                </div>
            </div>
            <div class="layui-form-item">
	            <input name="skipToPage" id="skipToPage"  type="hidden" value="${pager.pageNo}">
				<input type="hidden" id="pageNo" name="pageNo" value="${pager.pageNo}">
				<input type="hidden" id="totalPage" name="totalPage" value="${pager.totalPages}">
                <button class="layui-btn TM-btn-search searchbtn"    ><i class="layui-icon layui-unselect layui-tab-close">&#xe615;</i>搜索</button>
                <button class="layui-btn refreshbtn"  type="button"><i class="layui-icon layui-unselect layui-tab-close ">&#x1002;</i>刷新</button>  
            </div>
        </form>
       <!--  <div style="margin: 25px 0 10px 0; float: right;">
			<a class="layui-btn layui-btn-primary layui-btn-small"><i class="layui-icon">&#x1002;</i>导出统计报表</a>
		</div> -->
		<div style="margin: 25px 0 10px 0; float: left;"> 
			  <a   class="layui-btn layui-btn-radius layui-btn-small  layui-btn-normal"><i class="iconfont icon-im_dianhua1" ></i>&nbsp;呼出总数：${map.get("total")}次</a>
			  <a class="layui-btn layui-btn-radius layui-btn-small  "><i class="iconfont icon-customerservice_fill" ></i>&nbsp;有效呼叫：${map.get("yxtotal")}次</a>
			  <a  class="layui-btn layui-btn-radius layui-btn-small  layui-btn-warm"><i class="iconfont  icon-time" ></i>&nbsp;呼出时长：${map.get("timetotal")}</a>
			<%-- <span style="color: #f990ab">业绩金额：<fmt:formatNumber value="${totalmoney}" pattern="#,#00"/>元</span> --%>
		</div>
    </div>
    <div class="layui-field-box"> 
        <table class="site-table table-hover TM-table-news">
            <thead>
            <tr>
                <th style="width:5%;">编号</th>
               <!--  <th style="width:15%;">客户</th> -->
                <th style="width:5%;">通话时长</th>
                <th style="width:15%;">来、去电时间</th>
                <th style="width:10%;">接通状态</th>
                <th style="width:10%;">呼出号码</th>
                <th style="width:10%;">呼入号码</th>
                <th style="width:20%;">录音</th>
            </tr>
            </thead>
            <tbody>
	            
	             <c:forEach var="obj" items="${pager.resultList}" varStatus="o1">
	            	<tr>
		             	<td>${o1.index+1}</td>
		             <!--    <td></td> -->
		                <td>${obj.time==null?0:obj.time}秒</td>
		                <td>${obj.startTime.substring(0,19)}</td>
		                <td>
		                	<c:if test="${obj.type == 1}">已接来电</c:if>
		                	<c:if test="${obj.type == 2}">已接去电</c:if>
		                	<c:if test="${obj.type == 3}">未接来电</c:if>
		                	<c:if test="${obj.type == 4}">未接去电</c:if>
		                </td>
		                <td>${obj.calee} </td>
		                <td>${obj.caller}</td>	
		                <td>
		                	<c:if test="${obj.type == 1 || obj.type == 2}"> 
		                		<a class="layui-btn layui-btn-normal layui-btn-mini  " data="${obj.id}"   tfrecurl="${obj.fileUrl}" account="${obj.ownerAcc}" phone="" code="${obj.code}" dur="30" onclick="recordPlayYes(this)"   type="button"><i class="iconfont icon-playon" ></i>播放</a>
		                	</c:if>
		                </td>
		            </tr>
	             </c:forEach>
            </tbody>
        </table>
        <div class="admin-table-page">
            <div id="page" class="page"></div>
        </div>	
    </div>
</div>
 
<script>
    layui.config({
        base: 'plugins/layui/modules/'
    });
    layui.use(['element','laypage','form','laydate','layer'], function() {
        var $ = layui.jquery,
                laypage = layui.laypage,
                layer = layui.layer,
                element = layui.element(); //Tab的切换功能，切换事件监听等，需要依赖element模块
        var form = layui.form();
                
        //更新渲染
        form.render();
 
             
     	//点击搜索
        $(".searchbtn").on("click",function(){
      	  $("#skipToPage").val(1);
      	  form.submit();
        });
     	
     	
      	var pageNo = $("#pageNo").val();
    	var totalPage = $("#totalPage").val();   
        //page
        laypage({
            cont: 'page',
            curr: pageNo//'${pager.pageNo}'
            ,pages: totalPage//'${pager.totalPages}' //总页数
            ,
            groups: 5 //连续显示分页数
            ,
            jump: function(obj, first) {
                //得到了当前页，用于向服务端请求对应数据
                var curr = obj.curr;
                if(!first) {
                	$("#skipToPage").val(curr);
                	$("#calllogform").submit();
                }
            }
        });
    });
</script>


</body>
</html>